<%--
  Created by IntelliJ IDEA.
  User: Admin
  Date: 9/23 0023
  Time: 14:25
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Employee</title>
</head>
<body>
<c:if test="${empty requestScope.employee}">
    没有内容!
</c:if>
<c:if test="${!empty requestScope.employee}">
    <table border="1" cellpadding="10" cellspacing="0">
    <tr>
        <th>ID</th>
        <th>LastName</th>
        <th>Email</th>
        <th>Gender</th>
        <th>Department</th>
        <th>Edit</th>
        <th>Delete</th>
    </tr>
    <c:forEach items="${requestScope.employee}" var="emp">
        <tr>
            <td>${emp.id}</td>
            <td>${emp.lastName}</td>
            <td>${emp.email}</td>
            <td>${emp.gender==0 ? 'Femal':'Male'}</td>
            <td>${emp.department.departmentName}</td>
            <td><a href="edit/${emp.id}">Edit</a></td>
            <td><a href="delete/${emp.id}">Delete</a></td>
        </tr>
    </c:forEach>
    </table>

</c:if>
<a href="addEmp">Add Employee</a>
</body>
</html>